package com.yunhuakeji.wddx.control;

import java.io.InputStream;
import com.yunhuakeji.wddx.impl.IMReport;
import com.yunhuakeji.wddx.service.ReportService;
import com.yunhuakeji.wddx.service.WYBYService;
import com.yunhuakeji.wddx.utils.ResultUtil;

public class BGControllerApp extends ActionTicketSupport {
	private static final long serialVersionUID = 1L;

	private InputStream inputStream;
	private String callback, rm_xq,path,result;

	public BGControllerApp() throws Exception {
		super();
	}

	public String CJBGJump() {
		if (this.CheckTimeTicket("cjbg")) {
			path = this.getFunctionInterfaceList();
			return "Jump";
		} else {
			return "error";
		}
	}

	public String XFBGJump() {
		if (this.CheckTimeTicket("xfbg")) {
			path = this.getFunctionInterfaceList();
			return "Jump";
		} else {
			return "error";
		}
	}

	public String JYBGJump() {
		if (this.CheckTimeTicket("jybg")) {
			path = this.getFunctionInterfaceList();
			return "Jump";
		} else {
			return "error";
		}
	}

	public String getCJForPcDefault() {
		inputStream = new ResultUtil().resultString(callback, new WYBYService().getCjDefaultWithApp(this.getUserid(),this.getTicket()));
		return SUCCESS;
	}

	public String getScores() {
		
		result = new ReportService().getScoresWithApp(this.getUserid(), rm_xq,this.getTicket()).toString();
		
		return SUCCESS;
	}

	public String getScoresJson()
	{
		inputStream = new ResultUtil().resultString(callback, new IMReport().getScores(this.getUserid(),rm_xq,this.getTicket()));
		return SUCCESS;
	}
	
	public String getReportByCostOptions() {
		inputStream = new ResultUtil().resultString(callback, new ReportService().getReportByCostOptionsWithApp(this.getUserid(),this.getTicket()));
		
		return SUCCESS;
	}

	public String getReportByCost() {
		result =  new ReportService().getReportByCostWithApp(this.getUserid(), rm_xq,this.getTicket()).toString();
		
		return SUCCESS;
	}
	
	public String getReportByCostJson()
	{
		inputStream = new ResultUtil().resultString(callback, new ReportService().getReportByCostWithApp(this.getUserid(), rm_xq,this.getTicket()));
		
		return SUCCESS;
	}

	public String getReportByBorrowing() {
		result = new ReportService().getReportByBorrowingWithApp(this.getUserid(),this.getTicket()).toString();
		
		return SUCCESS;
	}

	public InputStream getInputStream() {
		return inputStream;
	}

	public void setInputStream(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public String getCallback() {
		return callback;
	}

	public void setCallback(String callback) {
		this.callback = callback;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getRm_xq() {
		return rm_xq;
	}

	public void setRm_xq(String rm_xq) {
		this.rm_xq = rm_xq;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getResult()
	{
		return result;
	}

	public void setResult(String result)
	{
		this.result = result;
	}
}
